home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / Retrace.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-11  |  3.4 KB  |  158 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Retrace.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __RETRACE__
  18. #define __RETRACE__
  19.  
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. /*    #include <ConditionalMacros.h>                                */
  25.  
  26. #ifndef __OSUTILS__
  27. #include <OSUtils.h>
  28. #endif
  29. /*    #include <MixedMode.h>                                        */
  30. /*    #include <Memory.h>                                            */
  31.  
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35.  
  36. #if GENERATINGPOWERPC
  37. #pragma options align=mac68k
  38. #endif
  39.  
  40. #ifdef __CFM68K__
  41. #pragma lib_export on
  42. #endif
  43.  
  44. typedef struct VBLTask VBLTask, *VBLTaskPtr;
  45.  
  46. /*
  47.         VBLProcPtr uses register based parameters on the 68k and cannot
  48.         be written in or called from a high-level language without the help of
  49.         mixed mode or assembly glue.
  50.  
  51.         In:
  52.          => vblTaskPtr      A0.L
  53. */
  54.  
  55. #if GENERATINGCFM
  56. typedef UniversalProcPtr VBLUPP;
  57. #else
  58. typedef Register68kProcPtr VBLUPP;
  59. #endif
  60.  
  61. struct VBLTask {
  62.     QElemPtr                        qLink;
  63.     short                            qType;
  64.     VBLUPP                            vblAddr;
  65.     short                            vblCount;
  66.     short                            vblPhase;
  67. };
  68. enum {
  69.     uppVBLProcInfo = kRegisterBased
  70.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterA0, SIZE_CODE(sizeof(VBLTaskPtr)))
  71. };
  72.  
  73. #if GENERATINGCFM
  74. #define NewVBLProc(userRoutine)        \
  75.         (VBLUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppVBLProcInfo, GetCurrentArchitecture())
  76. #else
  77. #define NewVBLProc(userRoutine)        \
  78.         ((VBLUPP) (userRoutine))
  79. #endif
  80.  
  81. #if GENERATINGCFM
  82. #define CallVBLProc(userRoutine, vblTaskPtr)        \
  83.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppVBLProcInfo, (vblTaskPtr))
  84. #else
  85. /* (*VBLProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
  86. #endif
  87.  
  88. extern pascal QHdrPtr GetVBLQHdr(void)
  89.  THREEWORDINLINE(0x2EBC, 0x0000, 0x0160);
  90.  
  91. #if !GENERATINGCFM
  92. #pragma parameter __D0 SlotVInstall(__A0, __D0)
  93. #endif
  94. extern pascal OSErr SlotVInstall(QElemPtr vblBlockPtr, short theSlot)
  95.  ONEWORDINLINE(0xA06F);
  96.  
  97. #if !GENERATINGCFM
  98. #pragma parameter __D0 SlotVRemove(__A0, __D0)
  99. #endif
  100. extern pascal OSErr SlotVRemove(QElemPtr vblBlockPtr, short theSlot)
  101.  ONEWORDINLINE(0xA070);
  102.  
  103. #if !GENERATINGCFM
  104. #pragma parameter __D0 AttachVBL(__D0)
  105. #endif
  106. extern pascal OSErr AttachVBL(short theSlot)
  107.  ONEWORDINLINE(0xA071);
  108.  
  109. #if !GENERATINGCFM
  110. #pragma parameter __D0 DoVBLTask(__D0)
  111. #endif
  112. extern pascal OSErr DoVBLTask(short theSlot)
  113.  ONEWORDINLINE(0xA072);
  114.  
  115. #if !GENERATINGCFM
  116. #pragma parameter __D0 VInstall(__A0)
  117. #endif
  118. extern pascal OSErr VInstall(QElemPtr vblTaskPtr)
  119.  ONEWORDINLINE(0xA033);
  120.  
  121. #if !GENERATINGCFM
  122. #pragma parameter __D0 VRemove(__A0)
  123. #endif
  124. extern pascal OSErr VRemove(QElemPtr vblTaskPtr)
  125.  ONEWORDINLINE(0xA034);
  126. /**/
  127. /* Custom Glue for 68k.*/
  128. /**/
  129. #if !GENERATINGCFM
  130. #ifndef CallVBLProc
  131.  
  132. #if !GENERATINGCFM
  133. #pragma parameter VBLProcPtr68K(__A1, __A0)
  134. #endif
  135. extern pascal void VBLProcPtr68K(VBLUPP userRoutine, VBLTaskPtr userTask)
  136.  FIVEWORDINLINE(0x48E7, 0xF030, 0x4E91, 0x4CDF, 0x0C0F);
  137. /* Movem A2-A3/D0-D3,-(SP)*/
  138. /* Jsr (A1)*/
  139. /* Movem (SP)+,A2-A3/D0-D3*/
  140. #define CallVBLProc(userRoutine, vblTaskPtr)  \
  141.     VBLProcPtr68K(userRoutine, vblTaskPtr);
  142. #endif
  143. #endif
  144.  
  145. #ifdef __CFM68K__
  146. #pragma lib_export off
  147. #endif
  148.  
  149. #if GENERATINGPOWERPC
  150. #pragma options align=reset
  151. #endif
  152.  
  153. #ifdef __cplusplus
  154. }
  155. #endif
  156.  
  157. #endif /* __RETRACE__ */
  158.